<template>
        <div class="account">
            <div class="account-head">
                <div class="account-img">
                    <img :src="account.img" alt="头像">
                    <div class="account-point">
                        <img src="@/assets/u95.svg" alt="">
                    </div>
                </div>
                <div style="margin:10px 0 0 10px;">
                    <span class="account-name">{{account.name}}</span>
                    <div class="account-tip">
                        <img src="./u93.svg" alt="tip">
                    </div>                    
                </div>

            </div>
            <div class="account-status">
                <div @mouseover="online" @mouseleave="onlineHighlight.highlight = false" :class="onlineHighlight"> <span>·</span> 在线</div>
                <div @mouseover="offline" @mouseleave="offlineHighlight.highlight = false" :class="offlineHighlight"> <span>·</span> 离线</div>
            </div>
        </div>
</template>

<script>
export default {
    data () {
        return {
            account : {
                img: require('./u94.svg'),
                name: '客服七尾',
            },
            onlineHighlight : {
                highlight : false
            },
            offlineHighlight : {
                highlight : false
            }
        }
    },
    methods : {
        online () {
            this.onlineHighlight.highlight = true
        },
        offline () {
            this.offlineHighlight.highlight = true
        }
    }
}
</script>

<style>
.account{
    width: 157px;
    height: 64px;
    text-align: center;
}

.account:hover .account-status{
    display: block;
}

.account-head{
    width: 157px;
    height: 64px;
    display: flex;
}

.account-img{
    width: 40px;
    height: 40px;
    margin: 7px;
    display: flex;
}

.account-name{
    position: relative;
    top: -15px;
    font-size: 13px;
    font-family: 'PingFangSC-Regular', 'PingFang SC', sans-serif;
    font-weight: 400;
    font-style: normal;
    font-size: 13px;
    text-align: left;
}

.account-point{
    display: inline-block;
    position: relative;
    left: -10px;
}

.account-tip{
    width: 30px;
    position: relative;
    top: -15px;
    display: inline-block;
}

.account-status{
    margin-top: 1px;
    width: 100%;
    background-color: white;
    display: none;
}

.highlight{
    background-color:rgba(0, 110, 255, 0.0980392156862745);
    color: dodgerblue;
}

.account-status div{
    height: 40px;
    line-height: 40px;
    text-align: left;
    padding-left: 30px;
}

.account-status div span{
    font-weight: bolder;
}
</style>